package com.ergwang.Model.admin.vo;

import com.ergwang.Model.admin.enumaration.OrderState;

/**
 * @author：ergwang
 * @Date: 2020/5/31
 * @Time: 22:22
 * @功能：用于后台管理系统分页查询的每个详细订单的VO
 */
public class PageOrderInfoVO {
    private Integer id;
    private Integer uesrid;
    private Integer goodsDetailIdid;
    private String goods;
    private String spec;
    private Integer goodsNum;
    private Double amount;
    private Integer stateId;
    private String state;
    private OrderByPage_UserVO user = new OrderByPage_UserVO();

    // 4个set方法
    public void setNickname(String nickname){
        user.setNickname(nickname);
    }
    public void setName(String name){
        user.setName(name);
    }
    public void setAddress(String address){
        user.setAddress(address);
    }
    public void setPhone(String phone){
        user.setPhone(phone);
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public Integer getUesrid() {
        return uesrid;
    }

    public void setUesrid(Integer uesrid) {
        this.uesrid = uesrid;
    }

    public Integer getGoodsDetailIdid() {
        return goodsDetailIdid;
    }

    public void setGoodsDetailIdid(Integer goodsDetailIdid) {
        this.goodsDetailIdid = goodsDetailIdid;
    }

    public String getGoods() {
        return goods;
    }

    public void setGoods(String goods) {
        this.goods = goods;
    }

    public String getSpec() {
        return spec;
    }

    public void setSpec(String spec) {
        this.spec = spec;
    }

    public Integer getGoodsNum() {
        return goodsNum;
    }

    public void setGoodsNum(Integer goodsNum) {
        this.goodsNum = goodsNum;
    }

    public Double getAmount() {
        return amount;
    }

    public void setAmount(Double amount) {
        this.amount = amount;
    }

    /**
     * 做些处理
     * dbutils 如何处理数据？ 取出每列的列名id 和 userId ==》 调用setId等方法
     * @return
     */
    public Integer getStateId() {
        return stateId;
    }

    public void setStateId(Integer stateId) {
        if (stateId.equals(OrderState.UN_PAID.getCode())){
            setState(OrderState.UN_PAID.getValue());
        }
        if (stateId.equals(OrderState.UN_SHIPED.getCode())){
            setState(OrderState.UN_SHIPED.getValue());
        }
        if (stateId.equals(OrderState.DELIVERED.getCode())){
            setState(OrderState.DELIVERED.getValue());
        }
        if (stateId.equals(OrderState.RECEIVED.getCode())){
            setState(OrderState.RECEIVED.getValue());
        }
        this.stateId = stateId;
    }

    public String getState() {
        return state;
    }

    public void setState(String state) {
        this.state = state;
    }

    public OrderByPage_UserVO getUser() {
        return user;
    }

    public void setUser(OrderByPage_UserVO user) {
        this.user = user;
    }
}
